package com.wuyan.warriorsoffate.tools

import android.os.Environment
import java.io.File

object Tools {
    fun read(filepath:String):Array<Int>?{
        val myExternalFile = File(Environment.getExternalStorageDirectory().path+"/"+filepath)
        if(!myExternalFile.isFile){
            //Toast.makeText(context,"文件读取错误$filepath",Toast.LENGTH_LONG).show()
            return null
        }
        return myExternalFile.readBytes().map { it.toInt() and 0xff}.toTypedArray()
    }
}